package com.ysx.service.impl;

import com.ysx.dao.ItemsDao;
import com.ysx.pojo.Items.Items;
import com.ysx.service.ItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @PROJECT_NAME: shopping-demo
 * @DESCRIPTION:
 * @USER: yyy
 * @DATE: 2021/11/1 23:27
 */
@Transactional//注解方式实现事务
@Component//为了能够让容器托管
public class ItemsServiceImpl implements ItemsService {

    @Autowired
    private ItemsDao itemsDao;

    @Override
    public List<Items> getItems() {
        return itemsDao.getItems();
    }

    @Override
    public int add(Items items) {
        return itemsDao.add(items);
    }
}
